/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.spreedairy.portal.service.persistence;

import com.liferay.portal.service.persistence.BasePersistence;

import com.spreedairy.portal.model.Recommendation;

/**
 * The persistence interface for the recommendation service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author SpreeDairy
 * @see RecommendationPersistenceImpl
 * @see RecommendationUtil
 * @generated
 */
public interface RecommendationPersistence extends BasePersistence<Recommendation> {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this interface directly. Always use {@link RecommendationUtil} to access the recommendation persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
	 */

	/**
	* Caches the recommendation in the entity cache if it is enabled.
	*
	* @param recommendation the recommendation
	*/
	public void cacheResult(
		com.spreedairy.portal.model.Recommendation recommendation);

	/**
	* Caches the recommendations in the entity cache if it is enabled.
	*
	* @param recommendations the recommendations
	*/
	public void cacheResult(
		java.util.List<com.spreedairy.portal.model.Recommendation> recommendations);

	/**
	* Creates a new recommendation with the primary key. Does not add the recommendation to the database.
	*
	* @param recommendationId the primary key for the new recommendation
	* @return the new recommendation
	*/
	public com.spreedairy.portal.model.Recommendation create(
		long recommendationId);

	/**
	* Removes the recommendation with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param recommendationId the primary key of the recommendation
	* @return the recommendation that was removed
	* @throws com.spreedairy.portal.NoSuchRecommendationException if a recommendation with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.Recommendation remove(
		long recommendationId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchRecommendationException;

	public com.spreedairy.portal.model.Recommendation updateImpl(
		com.spreedairy.portal.model.Recommendation recommendation, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the recommendation with the primary key or throws a {@link com.spreedairy.portal.NoSuchRecommendationException} if it could not be found.
	*
	* @param recommendationId the primary key of the recommendation
	* @return the recommendation
	* @throws com.spreedairy.portal.NoSuchRecommendationException if a recommendation with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.Recommendation findByPrimaryKey(
		long recommendationId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchRecommendationException;

	/**
	* Returns the recommendation with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param recommendationId the primary key of the recommendation
	* @return the recommendation, or <code>null</code> if a recommendation with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.Recommendation fetchByPrimaryKey(
		long recommendationId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the recommendation where itemId = &#63; and userId = &#63; and groupId = &#63; and companyId = &#63; or throws a {@link com.spreedairy.portal.NoSuchRecommendationException} if it could not be found.
	*
	* @param itemId the item ID
	* @param userId the user ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @return the matching recommendation
	* @throws com.spreedairy.portal.NoSuchRecommendationException if a matching recommendation could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.Recommendation findByUserId(
		long itemId, long userId, long groupId, long companyId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchRecommendationException;

	/**
	* Returns the recommendation where itemId = &#63; and userId = &#63; and groupId = &#63; and companyId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param itemId the item ID
	* @param userId the user ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @return the matching recommendation, or <code>null</code> if a matching recommendation could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.Recommendation fetchByUserId(
		long itemId, long userId, long groupId, long companyId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the recommendation where itemId = &#63; and userId = &#63; and groupId = &#63; and companyId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param itemId the item ID
	* @param userId the user ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @param retrieveFromCache whether to use the finder cache
	* @return the matching recommendation, or <code>null</code> if a matching recommendation could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.Recommendation fetchByUserId(
		long itemId, long userId, long groupId, long companyId,
		boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the recommendations where itemId = &#63; and groupId = &#63; and companyId = &#63;.
	*
	* @param itemId the item ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @return the matching recommendations
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.Recommendation> findByItemId(
		long itemId, long groupId, long companyId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the recommendations where itemId = &#63; and groupId = &#63; and companyId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param itemId the item ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @param start the lower bound of the range of recommendations
	* @param end the upper bound of the range of recommendations (not inclusive)
	* @return the range of matching recommendations
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.Recommendation> findByItemId(
		long itemId, long groupId, long companyId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the recommendations where itemId = &#63; and groupId = &#63; and companyId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param itemId the item ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @param start the lower bound of the range of recommendations
	* @param end the upper bound of the range of recommendations (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching recommendations
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.Recommendation> findByItemId(
		long itemId, long groupId, long companyId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first recommendation in the ordered set where itemId = &#63; and groupId = &#63; and companyId = &#63;.
	*
	* @param itemId the item ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching recommendation
	* @throws com.spreedairy.portal.NoSuchRecommendationException if a matching recommendation could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.Recommendation findByItemId_First(
		long itemId, long groupId, long companyId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchRecommendationException;

	/**
	* Returns the first recommendation in the ordered set where itemId = &#63; and groupId = &#63; and companyId = &#63;.
	*
	* @param itemId the item ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching recommendation, or <code>null</code> if a matching recommendation could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.Recommendation fetchByItemId_First(
		long itemId, long groupId, long companyId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last recommendation in the ordered set where itemId = &#63; and groupId = &#63; and companyId = &#63;.
	*
	* @param itemId the item ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching recommendation
	* @throws com.spreedairy.portal.NoSuchRecommendationException if a matching recommendation could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.Recommendation findByItemId_Last(
		long itemId, long groupId, long companyId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchRecommendationException;

	/**
	* Returns the last recommendation in the ordered set where itemId = &#63; and groupId = &#63; and companyId = &#63;.
	*
	* @param itemId the item ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching recommendation, or <code>null</code> if a matching recommendation could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.Recommendation fetchByItemId_Last(
		long itemId, long groupId, long companyId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the recommendations before and after the current recommendation in the ordered set where itemId = &#63; and groupId = &#63; and companyId = &#63;.
	*
	* @param recommendationId the primary key of the current recommendation
	* @param itemId the item ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next recommendation
	* @throws com.spreedairy.portal.NoSuchRecommendationException if a recommendation with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.Recommendation[] findByItemId_PrevAndNext(
		long recommendationId, long itemId, long groupId, long companyId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchRecommendationException;

	/**
	* Returns all the recommendations.
	*
	* @return the recommendations
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.Recommendation> findAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the recommendations.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of recommendations
	* @param end the upper bound of the range of recommendations (not inclusive)
	* @return the range of recommendations
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.Recommendation> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the recommendations.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of recommendations
	* @param end the upper bound of the range of recommendations (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of recommendations
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.Recommendation> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes the recommendation where itemId = &#63; and userId = &#63; and groupId = &#63; and companyId = &#63; from the database.
	*
	* @param itemId the item ID
	* @param userId the user ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @return the recommendation that was removed
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.Recommendation removeByUserId(
		long itemId, long userId, long groupId, long companyId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchRecommendationException;

	/**
	* Removes all the recommendations where itemId = &#63; and groupId = &#63; and companyId = &#63; from the database.
	*
	* @param itemId the item ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @throws SystemException if a system exception occurred
	*/
	public void removeByItemId(long itemId, long groupId, long companyId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the recommendations from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of recommendations where itemId = &#63; and userId = &#63; and groupId = &#63; and companyId = &#63;.
	*
	* @param itemId the item ID
	* @param userId the user ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @return the number of matching recommendations
	* @throws SystemException if a system exception occurred
	*/
	public int countByUserId(long itemId, long userId, long groupId,
		long companyId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of recommendations where itemId = &#63; and groupId = &#63; and companyId = &#63;.
	*
	* @param itemId the item ID
	* @param groupId the group ID
	* @param companyId the company ID
	* @return the number of matching recommendations
	* @throws SystemException if a system exception occurred
	*/
	public int countByItemId(long itemId, long groupId, long companyId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of recommendations.
	*
	* @return the number of recommendations
	* @throws SystemException if a system exception occurred
	*/
	public int countAll()
		throws com.liferay.portal.kernel.exception.SystemException;
}